import java.util.Scanner;

public class wuziqi {

    public static boolean[] PeopleRun(QiPan qiPan, String color) {
        if ("WHITE" == color) {
            System.out.print("请WHITE（#）方棋手下棋（坐标：(0~15,0~15)）：");
        } else if ("BLACK" == color) {
            System.out.print("请BLACK（@）方棋手下棋（坐标：(0~15,0~15)）：");
        }

        //输入横纵坐标（列数、行数）
        Scanner sc = new Scanner(System.in);
        int row = sc.nextInt();
        int colu = sc.nextInt();


        //下棋
        boolean res_Play = qiPan.play(row, colu, color);
        //显示棋盘
        qiPan.draw();
        boolean res_isWin = qiPan.isWin(row, colu, color);

        boolean[] ret = {res_Play, res_isWin};
        return ret;
    }

    public static void main(String[] args) {
        QiPan qiPan = new QiPan();
        qiPan.draw();

        boolean flag = true;
        int code = 2;
        String color;

        while (flag) {
            if (0 == code % 2) {
                color = "BLACK";
            } else {
                color = "WHITE";
            }

            boolean[] arr = wuziqi.PeopleRun(qiPan, color);
            if (arr[0]) {
                code++;
            } else {
                System.out.println("请" + color + "方棋手重新落子！");
            }
            flag = !arr[1];
            if (arr[1]) {
                System.out.println(color + "方棋手获得本次对局胜利！");
            }else {
                System.out.println("本次落子" + color + "方棋手未获胜~~~");
            }
        }
    }
}
